import request from '@/utils/request'

// 查询招标项目列表
export function listTender(query) {
    return request({
        url: '/bidding/tender/listTender',
        method: 'get',
        params: query
    })
}

// 查询招标项目详细
export function getTender(sid) {
    return request({
        url: '/bidding/tender/detailsFront/' + sid,
        method: 'get'
    })
}


// 新增招标项目
export function addTender(data) {
    return request({
        url: '/bidding/tender/addTender',
        method: 'post',
        data: data
    })
}

// 修改招标项目
export function updateTender(data) {
    return request({
        url: '/bidding/tender',
        method: 'put',
        data: data
    })
}

// 删除招标项目
export function delTender(sid) {
    return request({
        url: '/bidding/tender/' + sid,
        method: 'delete'
    })
}

// 查询招标项目与公告详细
export function findTenderNotice(sid) {
    return request({
        url: '/bidding/tender/findTenderAndNotice/' + sid,
        method: 'get'
    })
}

//查询竞标规则
export function findBiddingRule(sid,hid) {
    return request({
        url: '/bidding/bidTenderRules/getInfoBySid/' + hid + '/' + sid,
        method: 'get'
    })
}

export function findBiddingRuleBySid(sid) {
    return request({
        url: '/bidding/bidTenderRules/findBiddingRuleBySid/' + sid,
        method: 'get'
    })
}

// 查询招标项目竞价报名，供应商报名后才能参与投标，最后才能参与竞价列表
export function listRegistration(query) {
    return request({
        url: '/bidding/registration/list',
        method: 'get',
        params: query
    })
}

// 查询招标项目竞价报名，供应商报名后才能参与投标，最后才能参与竞价详细
export function getRegistration(sid,hid) {
    return request({
        url: '/bidding/registration/getInfoBySidAndHid/' + hid + '/' + sid,
        method: 'get'
    })
}

// 报名参加该招标项目，供应商报名后才能参与投标，最后才能参与竞价详细
export function gotoRegistration(data) {
    return request({
        url: '/bidding/registration',
        method: 'post',
        data: data
    })
}

// 删除招标项目竞价报名，供应商报名后才能参与投标，最后才能参与竞价
export function delRegistration(id) {
    return request({
        url: '/bidding/registration/' + id,
        method: 'delete'
    })
}

export function addTenderQuotation(data) {
    return request({
        url: '/bidding/tenderQuotation',
        method: 'post',
        data: data
    })
}

export function findBiddingList(sid,hid) {
    return request({
        url: '/bidding/tenderQuotation/find/' + hid + '/' + sid,
        method: 'get'
    })
}

export function findLastTenderQuotation(sid,hid) {
    return request({
        url: '/bidding/tenderQuotation/findLast/' + hid + '/' + sid,
        method: 'get'
    })
}

export function findProcurementPlan(aid) {
    return request({
        url: '/ppm/plan/' + aid,
        method: 'get'
    })
}






